package com.ean.backpack.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ean.backpack.domain.Recreationdescriptionlist;
import com.ean.backpack.repository.RecreationdescriptionlistRepository;
import com.ean.backpack.service.RecreationdescriptionlistService;

@Service
@Transactional
public class RecreationdescriptionlistServiceImpl implements
		RecreationdescriptionlistService {

	@Autowired
	RecreationdescriptionlistRepository recreationdescriptionlistRepository;

	public long countAllRecreationdescriptionlists() {
		return recreationdescriptionlistRepository.count();
	}

	public void deleteRecreationdescriptionlist(
			Recreationdescriptionlist recreationdescriptionlist) {
		recreationdescriptionlistRepository.delete(recreationdescriptionlist);
	}

	public Recreationdescriptionlist findRecreationdescriptionlist(Integer id) {
		return recreationdescriptionlistRepository.findOne(id);
	}

	public List<Recreationdescriptionlist> findAllRecreationdescriptionlists() {
		return recreationdescriptionlistRepository.findAll();
	}

	public List<Recreationdescriptionlist> findRecreationdescriptionlistEntries(
			int firstResult, int maxResults) {
		return recreationdescriptionlistRepository.findAll(
				new org.springframework.data.domain.PageRequest(firstResult
						/ maxResults, maxResults)).getContent();
	}

	public void saveRecreationdescriptionlist(
			Recreationdescriptionlist recreationdescriptionlist) {
		recreationdescriptionlistRepository.save(recreationdescriptionlist);
	}

	public Recreationdescriptionlist updateRecreationdescriptionlist(
			Recreationdescriptionlist recreationdescriptionlist) {
		return recreationdescriptionlistRepository
				.save(recreationdescriptionlist);
	}
}
